package com.baiyang.sharding.page;

import lombok.ToString;
import org.springframework.util.StringUtils;

/**
 * 分页实体
 */
@ToString
public class PageEntity {
    /**
     * 页码
     */
    private Integer pageOn;
    /**
     * 页数量
     */
    private Integer pageSize;
    /**
     * 排序方式
     */
    private String orderBy = "create_time";
    /**
     * 排序
     */
    private String sort = "desc";
    /**
     * 分页开始位置
     */
    private int pageStart;

    public Integer getPageOn() {
        return pageOn;
    }

    public void setPageOn(Integer pageOn) {
        this.pageOn = pageOn;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public String getOrderBy() {
        return orderBy;
    }

    public void setOrderBy(String orderBy) {
        if (StringUtils.hasLength(orderBy)) {
            this.orderBy = orderBy;
        }
    }

    public String getSort() {
        return sort;
    }

    public void setSort(String sort) {
        if (StringUtils.hasLength(sort)) {
            this.sort = sort;
        }
    }

    public int getPageStart() {
        return pageStart;
    }

    public void setPageStart(int pageStart) {
        this.pageStart = pageStart;
    }
}
